package com.wang.bootbuilder.controller.banner;

import com.wang.bootbuilder.entity.pojo.CrmBanner;
import com.wang.bootbuilder.service.CrmBannerService;
import com.wang.bootbuilder.tools.JsonResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/manage/bannerfront")
@Api(value = "/manage/bannerfront", description = "处理前台banner显示的controller")
public class BannerFrontController {

    @Autowired
    CrmBannerService crmBannerService;

    /*
    查询所有的banner
     */
    @GetMapping("getAllBanner")
    public JsonResult getAllBanner() {
        List<CrmBanner> bannerList = crmBannerService.selectAllBanner();
        return JsonResult.ok().data("bannerList", bannerList);
    }


}
